Optimal. Leaf size=185 \[ -\frac {i (c-i d)^{5/2} \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{2 a f}+\frac {(c+i d)^{3/2} (i c+4 d) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c+i d}}\right )}{2 a f}-\frac {(c+5 i d) d \sqrt {c+d \tan (e+f x)}}{2 a f}+\frac {(i c-d) (c+d \tan (e+f x))^{3/2}}{2 f (a+i a \tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.29, antiderivative size = 185, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 6, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3631, 3609,
3620, 3618, 65, 214} \begin {gather*} \frac {(-d+i c) (c+d \tan (e+f x))^{3/2}}{2 f (a+i a \tan (e+f x))}-\frac {d (c+5 i d) \sqrt {c+d \tan (e+f x)}}{2 a f}-\frac {i (c-i d)^{5/2} \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{2 a f}+\frac {(c+i d)^{3/2} (4 d+i c) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c+i d}}\right )}{2 a f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 65
Rule 214
Rule 3609
Rule 3618
Rule 3620
Rule 3631
Rubi steps
\begin {align*} \int \frac {(c+d \tan (e+f x))^{5/2}}{a+i a \tan (e+f x)} \, dx &=\frac {(i c-d) (c+d \tan (e+f x))^{3/2}}{2 f (a+i a \tan (e+f x))}+\frac {\int \sqrt {c+d \tan (e+f x)} \left (\frac {1}{2} a (2 c+i d) (c-3 i d)-\frac {1}{2} a (c+5 i d) d \tan (e+f x)\right ) \, dx}{2 a^2}\\ &=-\frac {(c+5 i d) d \sqrt {c+d \tan (e+f x)}}{2 a f}+\frac {(i c-d) (c+d \tan (e+f x))^{3/2}}{2 f (a+i a \tan (e+f x))}+\frac {\int \frac {\frac {1}{2} a \left (2 c^3-5 i c^2 d+4 c d^2+5 i d^3\right )+\frac {1}{2} a d \left (c^2-10 i c d+3 d^2\right ) \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx}{2 a^2}\\ &=-\frac {(c+5 i d) d \sqrt {c+d \tan (e+f x)}}{2 a f}+\frac {(i c-d) (c+d \tan (e+f x))^{3/2}}{2 f (a+i a \tan (e+f x))}+\frac {(c-i d)^3 \int \frac {1+i \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx}{4 a}+\frac {\left ((c+i d)^2 (c-4 i d)\right ) \int \frac {1-i \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx}{4 a}\\ &=-\frac {(c+5 i d) d \sqrt {c+d \tan (e+f x)}}{2 a f}+\frac {(i c-d) (c+d \tan (e+f x))^{3/2}}{2 f (a+i a \tan (e+f x))}-\frac {(i c+d)^3 \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {c-i d x}} \, dx,x,i \tan (e+f x)\right )}{4 a f}-\frac {\left ((c+i d)^2 (i c+4 d)\right ) \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {c+i d x}} \, dx,x,-i \tan (e+f x)\right )}{4 a f}\\ &=-\frac {(c+5 i d) d \sqrt {c+d \tan (e+f x)}}{2 a f}+\frac {(i c-d) (c+d \tan (e+f x))^{3/2}}{2 f (a+i a \tan (e+f x))}-\frac {(c-i d)^3 \text {Subst}\left (\int \frac {1}{-1-\frac {i c}{d}+\frac {i x^2}{d}} \, dx,x,\sqrt {c+d \tan (e+f x)}\right )}{2 a d f}-\frac {\left ((c+i d)^2 (c-4 i d)\right ) \text {Subst}\left (\int \frac {1}{-1+\frac {i c}{d}-\frac {i x^2}{d}} \, dx,x,\sqrt {c+d \tan (e+f x)}\right )}{2 a d f}\\ &=-\frac {i (c-i d)^{5/2} \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{2 a f}+\frac {(c+i d)^{3/2} (i c+4 d) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c+i d}}\right )}{2 a f}-\frac {(c+5 i d) d \sqrt {c+d \tan (e+f x)}}{2 a f}+\frac {(i c-d) (c+d \tan (e+f x))^{3/2}}{2 f (a+i a \tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.15, size = 260, normalized size = 1.41 \begin {gather*} \frac {\sec (e+f x) (\cos (f x)+i \sin (f x)) \left (\frac {2 \left (-i \sqrt {-c+i d} (c+i d)^2 (c-4 i d) \text {ArcTan}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {-c-i d}}\right )-\sqrt {-c-i d} (i c+d)^3 \text {ArcTan}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {-c+i d}}\right )\right ) (\cos (e)+i \sin (e))}{\sqrt {-c-i d} \sqrt {-c+i d}}+2 (i \cos (f x)+\sin (f x)) \left (\left (c^2+2 i c d-5 d^2\right ) \cos (e+f x)-4 i d^2 \sin (e+f x)\right ) \sqrt {c+d \tan (e+f x)}\right )}{4 f (a+i a \tan (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.32, size = 237, normalized size = 1.28
method | result | size |
derivativedivides | \(\frac {2 d^{2} \left (-i \sqrt {c +d \tan \left (f x +e \right )}+\frac {\left (i c^{3}-3 i c \,d^{2}+3 c^{2} d -d^{3}\right ) \arctan \left (\frac {\sqrt {c +d \tan \left (f x +e \right )}}{\sqrt {i d -c}}\right )}{4 d^{2} \sqrt {i d -c}}+\frac {-\frac {d \left (3 i c^{2} d -i d^{3}+c^{3}-3 c \,d^{2}\right ) \sqrt {c +d \tan \left (f x +e \right )}}{\left (i d +c \right ) \left (-d \tan \left (f x +e \right )+i d \right )}-\frac {\left (i c^{4}+9 i c^{2} d^{2}-4 i d^{4}+c^{3} d -11 c \,d^{3}\right ) \arctan \left (\frac {\sqrt {c +d \tan \left (f x +e \right )}}{\sqrt {-i d -c}}\right )}{\left (i d +c \right ) \sqrt {-i d -c}}}{4 d^{2}}\right )}{f a}\) | \(237\) |
default | \(\frac {2 d^{2} \left (-i \sqrt {c +d \tan \left (f x +e \right )}+\frac {\left (i c^{3}-3 i c \,d^{2}+3 c^{2} d -d^{3}\right ) \arctan \left (\frac {\sqrt {c +d \tan \left (f x +e \right )}}{\sqrt {i d -c}}\right )}{4 d^{2} \sqrt {i d -c}}+\frac {-\frac {d \left (3 i c^{2} d -i d^{3}+c^{3}-3 c \,d^{2}\right ) \sqrt {c +d \tan \left (f x +e \right )}}{\left (i d +c \right ) \left (-d \tan \left (f x +e \right )+i d \right )}-\frac {\left (i c^{4}+9 i c^{2} d^{2}-4 i d^{4}+c^{3} d -11 c \,d^{3}\right ) \arctan \left (\frac {\sqrt {c +d \tan \left (f x +e \right )}}{\sqrt {-i d -c}}\right )}{\left (i d +c \right ) \sqrt {-i d -c}}}{4 d^{2}}\right )}{f a}\) | \(237\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 1053 vs. \(2 (146) = 292\).
time = 0.99, size = 1053, normalized size = 5.69 \begin {gather*} \frac {{\left (a f \sqrt {-\frac {c^{5} - 5 i \, c^{4} d - 10 \, c^{3} d^{2} + 10 i \, c^{2} d^{3} + 5 \, c d^{4} - i \, d^{5}}{a^{2} f^{2}}} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (\frac {2 \, {\left (c^{3} - 2 i \, c^{2} d - c d^{2} + {\left (i \, a f e^{\left (2 i \, f x + 2 i \, e\right )} + i \, a f\right )} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {c^{5} - 5 i \, c^{4} d - 10 \, c^{3} d^{2} + 10 i \, c^{2} d^{3} + 5 \, c d^{4} - i \, d^{5}}{a^{2} f^{2}}} + {\left (c^{3} - 3 i \, c^{2} d - 3 \, c d^{2} + i \, d^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{c^{2} - 2 i \, c d - d^{2}}\right ) - a f \sqrt {-\frac {c^{5} - 5 i \, c^{4} d - 10 \, c^{3} d^{2} + 10 i \, c^{2} d^{3} + 5 \, c d^{4} - i \, d^{5}}{a^{2} f^{2}}} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (\frac {2 \, {\left (c^{3} - 2 i \, c^{2} d - c d^{2} + {\left (-i \, a f e^{\left (2 i \, f x + 2 i \, e\right )} - i \, a f\right )} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {c^{5} - 5 i \, c^{4} d - 10 \, c^{3} d^{2} + 10 i \, c^{2} d^{3} + 5 \, c d^{4} - i \, d^{5}}{a^{2} f^{2}}} + {\left (c^{3} - 3 i \, c^{2} d - 3 \, c d^{2} + i \, d^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{c^{2} - 2 i \, c d - d^{2}}\right ) + a f \sqrt {-\frac {c^{5} - 5 i \, c^{4} d + 5 \, c^{3} d^{2} - 25 i \, c^{2} d^{3} + 40 \, c d^{4} + 16 i \, d^{5}}{a^{2} f^{2}}} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (\frac {{\left (i \, c^{3} + 2 \, c^{2} d + 7 i \, c d^{2} - 4 \, d^{3} + {\left (a f e^{\left (2 i \, f x + 2 i \, e\right )} + a f\right )} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {c^{5} - 5 i \, c^{4} d + 5 \, c^{3} d^{2} - 25 i \, c^{2} d^{3} + 40 \, c d^{4} + 16 i \, d^{5}}{a^{2} f^{2}}} + {\left (i \, c^{3} + 3 \, c^{2} d + 4 i \, c d^{2}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{2 \, a f}\right ) - a f \sqrt {-\frac {c^{5} - 5 i \, c^{4} d + 5 \, c^{3} d^{2} - 25 i \, c^{2} d^{3} + 40 \, c d^{4} + 16 i \, d^{5}}{a^{2} f^{2}}} e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (\frac {{\left (i \, c^{3} + 2 \, c^{2} d + 7 i \, c d^{2} - 4 \, d^{3} - {\left (a f e^{\left (2 i \, f x + 2 i \, e\right )} + a f\right )} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {c^{5} - 5 i \, c^{4} d + 5 \, c^{3} d^{2} - 25 i \, c^{2} d^{3} + 40 \, c d^{4} + 16 i \, d^{5}}{a^{2} f^{2}}} + {\left (i \, c^{3} + 3 \, c^{2} d + 4 i \, c d^{2}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{2 \, a f}\right ) + 2 \, {\left (i \, c^{2} - 2 \, c d - i \, d^{2} + {\left (i \, c^{2} - 2 \, c d - 9 i \, d^{2}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{8 \, a f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {i \left (\int \frac {c^{2} \sqrt {c + d \tan {\left (e + f x \right )}}}{\tan {\left (e + f x \right )} - i}\, dx + \int \frac {d^{2} \sqrt {c + d \tan {\left (e + f x \right )}} \tan ^{2}{\left (e + f x \right )}}{\tan {\left (e + f x \right )} - i}\, dx + \int \frac {2 c d \sqrt {c + d \tan {\left (e + f x \right )}} \tan {\left (e + f x \right )}}{\tan {\left (e + f x \right )} - i}\, dx\right )}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 464 vs. \(2 (146) = 292\).
time = 0.62, size = 464, normalized size = 2.51 \begin {gather*} -\frac {2 i \, \sqrt {d \tan \left (f x + e\right ) + c} d^{2}}{a f} + \frac {{\left (c^{3} - 3 i \, c^{2} d - 3 \, c d^{2} + i \, d^{3}\right )} \arctan \left (-\frac {2 \, {\left (i \, \sqrt {d \tan \left (f x + e\right ) + c} c + i \, \sqrt {c^{2} + d^{2}} \sqrt {d \tan \left (f x + e\right ) + c}\right )}}{\sqrt {2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} c - i \, \sqrt {2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} d + \sqrt {c^{2} + d^{2}} \sqrt {2 \, c + 2 \, \sqrt {c^{2} + d^{2}}}}\right )}{a \sqrt {2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} f {\left (-\frac {i \, d}{c + \sqrt {c^{2} + d^{2}}} + 1\right )}} + \frac {{\left (-i \, c^{3} - 2 \, c^{2} d - 7 i \, c d^{2} + 4 \, d^{3}\right )} \arctan \left (\frac {2 \, {\left (\sqrt {d \tan \left (f x + e\right ) + c} c - \sqrt {c^{2} + d^{2}} \sqrt {d \tan \left (f x + e\right ) + c}\right )}}{c \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} + i \, \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} d - \sqrt {c^{2} + d^{2}} \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}}}\right )}{a \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} f {\left (\frac {i \, d}{c - \sqrt {c^{2} + d^{2}}} + 1\right )}} + \frac {\sqrt {d \tan \left (f x + e\right ) + c} c^{2} d + 2 i \, \sqrt {d \tan \left (f x + e\right ) + c} c d^{2} - \sqrt {d \tan \left (f x + e\right ) + c} d^{3}}{2 \, {\left (d \tan \left (f x + e\right ) - i \, d\right )} a f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 9.36, size = 2500, normalized size = 13.51 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________